package com.zcckj.demo.app.controller;

import com.zcckj.common.mvc.result.Result;
import com.zcckj.common.mvc.result.ResultBuilder;
import com.zcckj.demo.app.model.dto.PlaceOrderDTO;
import com.zcckj.demo.app.service.BusinessOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * <p>
 *  订单
 * </p>
 *
 * @author zhangjie
 * @since 2019-08-27
 */
@Api(tags = "下单",value = "下单哦")
@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private BusinessOrderService businessOrderService;

    @ApiOperation("下单")
    @PostMapping("/place")
    public Result placeOrder(@RequestBody @Validated PlaceOrderDTO placeOrderDTO){
        businessOrderService.placeOrder(placeOrderDTO);
        return ResultBuilder.ok();
    }
}
